package response

var (
	Success          = 0
	Unauthorized     = 401
	ParamError       = 503
	PermissionDenied = 403
	ServerError      = 500
)

var ErrorMessage = map[int]string{
	0:     "success",
	40000: "user error",
	40001: "参数有误",
	40002: "无访问权限",
	50000: "服务异常 请稍后重试或联系客服处理",
	50001: "请求过多",
	50002: "重复操作",
}

func message(code int) (msg string) {
	//
	msg, ok := ErrorMessage[code]
	if ok {
		return
	}

	//
	if code < 50000 {
		msg = ErrorMessage[40000]
	} else {
		msg = ErrorMessage[50000]
	}
	return
}
